home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / programming / amos / amoslist-0499 / amoslist / 000004_nobody_Thu Apr 1 14:39:18 1999.msg < prev    next >
Internet Message Format  |  1999-05-17  |  5KB

  1. Received: from onelist.com (pop.onelist.com [209.207.164.213])
  2.     by osf1.gmu.edu (8.8.8/8.8.8) with SMTP id OAA09871
  3.     for <mcox4@osf1.gmu.edu>; Thu, 1 Apr 1999 14:39:16 -0500 (EST)
  4. Received: (qmail 14256 invoked by alias); 1 Apr 1999 19:16:26 -0000
  5. Received: (qmail 14250 invoked from network); 1 Apr 1999 19:16:26 -0000
  6. Received: from unknown (HELO mail.enterprise.net) (194.72.192.18) by pop.onelist.com with SMTP; 1 Apr 1999 19:16:26 -0000
  7. Received: from enterprise.net (andrewcrowe@max05-034.enterprise.net [194.72.197.34]) by mail.enterprise.net (8.8.5/8.8.5) with SMTP id UAA05671 for <amos-list@onelist.com>; Thu, 1 Apr 1999 20:39:10 +0100 (GMT/BST)
  8. From: Andrew Crowe <andrewcrowe@enterprise.net>
  9. To: amos-list@onelist.com
  10. Date: Thu, 01 Apr 1999 10:32:55 +0000
  11. Message-ID: <yam7760.2755.1197442784@mail.enterprise.net>
  12. In-Reply-To: <000a01be7baa$6cf4ec80$7d44989e@mirex>
  13. X-Mailer: YAM 2.0Preview7 [020] - Amiga Mailer by Marcel Beck - http://www.yam.ch
  14. Mailing-List: list amos-list@onelist.com; contact amos-list-owner@onelist.com
  15. Delivered-To: mailing list amos-list@onelist.com
  16. Precedence: bulk
  17. List-Unsubscribe: <mailto:amos-list-unsubscribe@ONElist.com>
  18. Reply-to: amos-list@onelist.com
  19. Mime-Version: 1.0
  20. Content-type: multipart/mixed; boundary="BOUNDARY.1197442784.1"
  21. Subject: [amos-list] Sample effects
  22. Status: O
  23. X-Status: 
  24.  
  25. Warning: This is a message in MIME format. Your mail reader does not
  26. support MIME. Some parts of this message will be readable as plain text.
  27. To see the rest, you will need to upgrade your mail reader. Following are
  28. some URLs where you can find MIME-capable mail programs for common platforms:
  29.  
  30.   Amiga............: YAM          http://www.yam.ch/
  31.   Unix.............: Metamail     ftp://ftp.bellcore.com/nsb/
  32.   Windows/Macintosh: Eudora       http://www.qualcomm.com/
  33.  
  34. General info about MIME can be found at:
  35.  
  36. http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/mime-faq/top.html
  37.  
  38.  
  39. --BOUNDARY.1197442784.1
  40. Content-Type: text/plain
  41.  
  42. Hi Everybody,
  43.  
  44.    I know someone wanted a program the creates effects like echo, so here's
  45. one.
  46.  
  47. Its actually a mixing routine I developed, but I realised that it could be
  48. used to create effects like echo's. 
  49.  
  50.    It might also help you do other effects by pointing you in the right
  51. direction ;)  
  52.  
  53. See ya.
  54. -- 
  55.        Manta Soft  -  Amiga programing & web page designing
  56.    Http://members.tripod.com/~mantasoft/          ICQ: 
  57.      --     Updated  27/3/99      --            21829166
  58.   - ------------------- Quote of the day: -------------------- -
  59. Anyone can make mistakes, but only an idiot persists in his error.
  60. -- Cicero
  61.  
  62. --BOUNDARY.1197442784.1
  63. Content-Type: text/plain; name="SampleEcho.asc"
  64. Content-Disposition: attachment; filename="SampleEcho.asc"
  65.  
  66.  
  67. F$=Fsel$("")
  68. Open In 1,F$
  69. L=Lof(1)
  70. Close 1
  71. Reserve As Work 5,L
  72. Bload F$,Start(5)
  73. Rem    load any old sample to memory for now 
  74.  
  75.  
  76.  
  77. ECHO[5,6,7,2000]
  78. Rem  call the echo procedure, starting from bank 5 to bank 7 using 
  79. Rem   bank 6 as a tempory bank and with a 2000 byte offset to the echo 
  80.  
  81.  
  82. Sam Raw %1111,Start(7),L,13964
  83. Print "Press any key"
  84. Wait Key 
  85. Cls 
  86.  
  87. ECHO[5,6,7,5000]
  88. Sam Raw %1111,Start(7),L,13964
  89. Print "Press any key"
  90. Wait Key 
  91. Cls 
  92.  
  93.  
  94.  
  95. Procedure ECHO[BANK,TEMPBANK,DESTBANK,ECHOOFFSET]
  96.    If ECHOOFFSET>0
  97.       
  98.       L=Length(BANK)
  99.       
  100.       Reserve As Work TEMPBANK,L+ECHOOFFSET
  101.       Copy Start(BANK),Start(BANK)+L To Start(TEMPBANK)+ECHOOFFSET-1
  102.       Rem  create the echo offsett 
  103.       
  104.       
  105.       MIX[BANK,TEMPBANK,DESTBANK]
  106.       Rem  mix the two banks to create the echo
  107.       
  108.       Erase(TEMPBANK)
  109.       
  110.    End If 
  111. End Proc
  112.  
  113.  
  114.  
  115.  
  116. Procedure MIX[BANK1,BANK2,DESTBANK]
  117.    L=Max(Length(BANK1),Length(BANK2))
  118.    
  119.    
  120.    Reserve As Chip Work DESTBANK,L
  121.    
  122.    
  123.    S1=Start(BANK1) : S2=Start(BANK2) : SD=Start(DESTBANK)
  124.    
  125.    For A=0 To L-1
  126.       
  127.       P1=Peek(A+S1)
  128.       P2=Peek(A+S2)
  129.       Rem read sample data from memory   
  130.       
  131.       P1=(P1+128) mod 256
  132.       P1=P1-128
  133.       P2=(P2+128) mod 256
  134.       P2=P2-128
  135.       Rem    convert sample data into signed data so we can use it.
  136.       
  137.       P1=P1/2
  138.       P2=P2/2
  139.       Rem Half the samples so that the volume doesn't exceed 127 
  140.       
  141.       
  142.       P=P1+P2
  143.       Rem mix the samples
  144.       
  145.       If P<-127
  146.          P=-127
  147.       End If 
  148.       If P>127
  149.          P=127
  150.       End If 
  151.       Rem  make sure the volume doesn't exceed 127.
  152.       
  153.       
  154.       Poke A+SD,P
  155.       
  156.       
  157.       
  158.       Rem -------------------
  159.       If A mod 1000=0
  160.          Print At(0,0);A;"/";L
  161.       End If 
  162.       Rem -------------- tempory progress meter
  163.       
  164.    Next 
  165.    
  166.    
  167. End Proc
  168.  
  169.  
  170. --BOUNDARY.1197442784.1--
  171.  
  172.